using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using Material.Entity;
using System.Configuration;
using System.Data.SqlClient;
using Material.App.Report.Report;
using Material.App.Report.Dataset;

namespace Material.App
{
    public partial class FrmRptPenjBarang : Form
    {
        private string connStr = ConfigurationManager.ConnectionStrings["dbconnection"].ToString();
        //private TblSatuan tblSatuan;
        private TblTransPenjBarangDTLEntity tblTransPenjBarangDTLEntity;

        public static int IdHDR;

        public FrmRptPenjBarang()
        {
            InitializeComponent();
        }

        private void FrmRptSatuan_Load(object sender, EventArgs e)
        {
            
           
        }

        private void crystalReportViewer1_Load(object sender, EventArgs e)
        {
            tblTransPenjBarangDTLEntity = new TblTransPenjBarangDTLEntity(connStr);
            SqlCommand comm = tblTransPenjBarangDTLEntity.GetCommandReportPenjualan(IdHDR);
            SqlDataAdapter adp = new SqlDataAdapter(comm);
            dsTblSatuan ds = new dsTblSatuan();
            ds.Clear();
            adp.Fill(ds, "dtPenjualanBarang");

            
            RptPenjualanBarang rpt = new RptPenjualanBarang();
            rpt.SetDataSource(ds);
            crystalReportViewer1.ReportSource = rpt;
        }
    }
}